import ReactDOM from 'react-dom/client'
import React, { Suspense } from 'react'
import App from './App.tsx'
// import './index.css'

// 全局css
import "./styles/index.scss"

// 淘宝适配
import "lib-flexible"

// mock
// import "../mock/data.ts"
import { mockXHR } from '../mock';
mockXHR();

// if (process.env.NODE_ENV !== 'production') {
//   mockXHR();
// }
// import "../mock/api"



// import { Provider } from 'react-redux'
import { Provider } from 'react-redux'
import { store } from './rtk/store.ts'
import {
    HashRouter as Hash,
    BrowserRouter as Histiry,
} from 'react-router-dom'

import { MyLoad } from './components/MyLoad.tsx'

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
    <Provider store={store}>
        <Hash>
            <Suspense fallback={< MyLoad />}>
                <App/>
            </Suspense>
        </Hash>
    </Provider>
)
